#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+1000;
typedef long long LL;
const LL mod=998244353;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL a[maxn],b[maxn];
int main(void){
   cin.tie(0);std::ios::sync_with_stdio(false);
   LL n;cin>>n;
   LL res=0;
   for(LL i=0;i<n;i++) cin>>a[i];
   for(LL i=0;i<n;i++) cin>>b[i],res+=b[i];
   for(LL i=0;i<n;i++){
       LL ans=0;
       if(i>=3){
        cout<<ans<<" ";
        continue;
       }
       if(i==0){

         for(LL j=1;j<n;j++){
            ans=(ans%mod+a[j]%mod*(res%mod-b[0]%mod+mod)%mod)%mod;
         }

       }
       if(i==1){
            for(LL j=2;j<n;j++){
                ans=(ans%mod+a[0]%mod*b[j]%mod)%mod;
            }
            for(LL j=2;j<n;j++){
                ans=(ans%mod+b[0]%mod*a[j]%mod)%mod;
            }
            ans=(ans%mod+a[0]%mod*b[0]%mod)%mod;
       }
       if(i==2){
           ans=(ans%mod+a[0]%mod*b[1]%mod)%mod;
           ans=(ans%mod+a[1]%mod*b[0]%mod)%mod;
       }
       cout<<ans%mod<<" ";
   }
   cout<<"\n";
   return 0;
}
